package cartagows;

import java.util.ArrayList;


public class WSMsgBasicFilter implements IWSMsgFilter {

	private static final long serialVersionUID = 745363800L;
	private ArrayList<String> opList;

	public WSMsgBasicFilter(String opList){

		this.opList = new ArrayList<String>();
		String[] splitted = opList.split("\\|");

		for(int i=0;i<splitted.length;i++)
			this.opList.add(splitted[i]);
	}
	
	public boolean match(WSMsgInfo ctx){
		return (this.opList.contains(ctx.getOperationName()) || this.opList.contains(ctx.getWSAAction()));
	}
}